import request from '@/config/axios'

// 上级变动 VO
export interface TopRecordVO {
  id: number // ID
}

// 上级变动 API
export const TopRecordApi = {
  // 查询上级变动分页
  getTopRecordPage: async (params: any) => {
    return await request.get({ url: `/wo/top-record/page`, params })
  },

  // 查询上级变动详情
  getTopRecord: async (id: number) => {
    return await request.get({ url: `/wo/top-record/get?id=` + id })
  },

  // 新增上级变动
  createTopRecord: async (data: TopRecordVO) => {
    return await request.post({ url: `/wo/top-record/create`, data })
  },

  // 修改上级变动
  updateTopRecord: async (data: TopRecordVO) => {
    return await request.put({ url: `/wo/top-record/update`, data })
  },

  // 删除上级变动
  deleteTopRecord: async (id: number) => {
    return await request.delete({ url: `/wo/top-record/delete?id=` + id })
  },

  // 导出上级变动 Excel
  exportTopRecord: async (params) => {
    return await request.download({ url: `/wo/top-record/export-excel`, params })
  }
}